package com.example.springbootmq.sender;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Component;

import javax.jms.Queue;

/**
 * @ProjectName: mq-demo
 * @Auther: GERRY
 * @Date: 2019/2/25 21:48
 * @Description:
 */
@Component
public class ActiveMqSender {
    @Autowired
    private JmsMessagingTemplate jmsMessagingTemplate;

    @Autowired
    private Queue queue;


    public void send(String message) {
        jmsMessagingTemplate.convertAndSend(this.queue, message);
    }
}
